<%@ page import="cn.edu.ujn.shi.dao.LoginLog" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ page import="cn.edu.ujn.shi.dao.Msg" %>
<%@ include file="header-admin.jsp" %>
<center>
    <center><img src='images/用户.png' height=70px><font size='+4' face='楷体'
                                                         color='#7D26CD'><b>用户登录管理</b></font></center>
    <form action="loginLog" method="get">
        <label for="username">按用户名搜索：</label>
        <input type="text" id="username" name="username">
        <button type="submit">搜索</button>
    </form>
    <table border="1">
        <thead>
        <tr bgcolor='#E0EEE0'>
            <th>ID</th>
            <th>用户名</th>
            <th>用户身份</th>
            <th>登录时间</th>
            <th>状态</th>
            <th>失败原因</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>

        <% List<LoginLog> logs = (List<LoginLog>) request.getAttribute("logs");
            for (int i = 0; i < logs.size(); i++) {
                out.println("    <tr>" +
                        "        <td>" + logs.get(i).getId() + "</td>" +
                        "        <td>" + logs.get(i).getUsername() + "</td>" +
                        "        <td>" + logs.get(i).getJuse() + "</td>" +
                        "        <td>" + logs.get(i).getLoginTime() + "</td>" +
                        "        <td>" + logs.get(i).getStatus() + "</td>" +
                        "        <td>" + logs.get(i).getShibaiyuanyin() + "</td>" +
                        " <td><a href='deleteLoginLogServlet?id=" + logs.get(i).getId() + "'>删除日志</a></td>" +
                        "    </tr>");
            }
        %>
        </tbody>
    </table>
</center>
</body>
<%@ include file="footer.jsp" %>
